package datahandling;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class OutPut {

	public  static void outTxt(String path,String fileName,String data){
		String fileNameTemp = path + "//" + fileName+".txt";
		File outFile = new File(fileNameTemp);
		try{
			if(!outFile.exists()){//文件不存在则创建
				outFile.createNewFile();
			}
		    FileWriter fileWritter = new FileWriter(fileNameTemp,true);
	        BufferedWriter bufferWritter = new BufferedWriter(fileWritter);
	        bufferWritter.write(data);
	        bufferWritter.close();
	        System.out.println("File "+fileName+" compeleted");
		}
		catch (IOException e){
		      e.printStackTrace();
		}
	}
}
